Skip to content

Add declarations for more package ecosystems - #75

Merged
andrew merged 1 commit into
mainfrom
codex/more-source-declarations
Aug 29, 2026
Merged

Add declarations for more package ecosystems#75
andrew merged 1 commit into
mainfrom
codex/more-source-declarations

Conversation

@andrew

@andrew andrew commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Add source declarations for Cargo, Go, NuGet, Hex, and Gleam so callers can identify and compare requirements without parsing each manifest again.

Declarations now carry direct versus indirect status, preserve parser-supplied PURLs, and use stable source locations for aliases, target-specific dependencies, and repeated entries. Registry checks exclude local, Git, replaced, workspace, and other non-registry sources while leaving the existing dependency inventory intact. NuGet central package management through Directory.Packages.props is included.

Hex alias locations stay tied to the source atom. Cargo and NuGet retain their prior Dependencies behavior while exposing the extra declaration data.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the manifest parsing surface to emit Declarations for additional ecosystems (Cargo, RubyGems, Go, NuGet, Hex, Gleam) with stable per-source Locations, preserved parser-supplied PURLs, and a new Direct flag to distinguish explicit vs indirect requirements.

Changes:

  • Add Direct to Declaration and standardize stable location generation via core.NextLocation.
  • Extend multiple ecosystem parsers to populate Result.Declarations (including NuGet central package management via Directory.Packages.props).
  • Preserve parser-supplied declaration PURLs in the public Parse wrapper, and update tests/docs/testdata accordingly.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
testdata/nuget/Directory.Packages.props Adds NuGet central package management fixture.
README.md Documents new Direct field and expanded declaration support; adds NuGet file type.
manifests.go Preserves parser-supplied declaration PURLs via declarationPURL.
manifests_test.go Adds declaration PURL/directness test cases for new ecosystems and preservation behavior.
internal/pypi/pypi.go Uses core.NextLocation for stable declaration locations; marks declarations direct.
internal/nuget/nuget.go Adds declarations for NuGet manifests and adds Directory.Packages.props parser.
internal/nuget/nuget_test.go Adds/extends tests validating NuGet declarations and location stability.
internal/npm/npm.go Marks npm declarations as direct.
internal/maven/declarations.go Marks Maven declarations as direct.
internal/hex/hex.go Adds Hex declarations with alias/non-registry handling and stable locations.
internal/hex/hex_test.go Adds tests for Mix declarations and non-registry filtering.
internal/golang/golang.go Adds Go module declarations; skips replaced modules; introduces replace scanning.
internal/golang/golang_test.go Adds tests for Go declarations, including indirect/tool/replace behavior.
internal/gleam/gleam.go Adds Gleam declarations for runtime and dev dependencies.
internal/gleam/gleam_test.go Adds tests verifying Gleam declarations and directness.
internal/github_actions/github_actions.go Uses core.NextLocation and marks action declarations direct.
internal/gem/rubygems.go Adds Gemfile/gemspec declarations with registry/non-registry handling and stable locations.
internal/gem/gem_test.go Adds tests for Gemfile/gemspec declarations and block/context behavior.
internal/core/types.go Adds Direct to core.Declaration with documentation.
internal/core/helpers.go Introduces core.NextLocation helper for stable repeated-entry locations.
internal/cargo/cargo.go Adds Cargo declarations across tables/targets/workspace with registry filtering.
internal/cargo/cargo_test.go Adds tests validating Cargo declarations and ensuring Dependencies behavior is unchanged.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/nuget/nuget.go Outdated
Comment thread internal/golang/golang.go
Comment thread internal/gem/rubygems.go Outdated
@andrew
andrew force-pushed the codex/more-source-declarations branch from de179e1 to ddc3c1f Compare August 19, 2026 16:56
Extend Declaration with a Direct flag, preserve parser-supplied PURLs,
and extract the location-suffix logic into core.NextLocation. Register a
Directory.Packages.props parser for NuGet central package management.
@andrew
andrew force-pushed the codex/more-source-declarations branch from 40fc0fa to c2d04ce Compare August 29, 2026 10:18
@andrew
andrew merged commit 97a3782 into main Aug 29, 2026
5 checks passed
@andrew
andrew deleted the codex/more-source-declarations branch August 29, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants